//
//  EMLaunchViewController.swift
//  Hyphenate-Demo-Swift
//
//  Created by dujiepeng on 2017/6/12.
//  Copyright © 2017 dujiepeng. All rights reserved.
//

import UIKit
import Hyphenate


let animationDuration = 1.0

class EMLaunchViewController: UIViewController, EMClientDelegate {
    @IBOutlet weak var splash_word: UILabel!
    override func viewDidLoad() {
        super.viewDidLoad()

        splash_word.text = "Shh… don’t tell your fake friends".localized();
        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + animationDuration, execute: {
            if EMClient.shared().isLoggedIn {
                NotificationCenter.default.post(name: NSNotification.Name(rawValue:KNOTIFICATION_LOGINCHANGE), object: NSNumber(value: true)) 
            } else {
                NotificationCenter.default.post(name: NSNotification.Name(rawValue:KNOTIFICATION_LOGINCHANGE), object: NSNumber(value: false)) 
            }
        }) 
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated) 
        UIApplication.shared.statusBarStyle = UIStatusBarStyle.lightContent 
    }
    

}
